package com.miplus.ccrm.core.pojo;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 任务执行日志
 * @TableName FI_CPDO_TRACE
 */
@TableName(value ="FI_CPDO_TRACE")
@Data
@KeySequence(value ="SEQ_FI_CPDO_TRACE")
public class FiCpdoTrace implements Serializable {
    /**
     * 序号
     */
    @TableId(type = IdType.INPUT)
    private Integer id;

    /**
     * 任务ID
     */
    private String taskid;

    /**
     * 任务名称
     */
    private String taskname;

    /**
     * 执行模式，自动/手动
     */
    private String domode;

    /**
     * 日志类型
     */
    private String tasktype;

    /**
     * 执行状态
     */
    private String status;

    /**
     * 开始时间
     */
    private Date startdt;

    /**
     * 结束时间
     */
    private Date enddt;

    /**
     * 执行结果
     */
    private String doresult;

    /**
     * 执行人
     */
    private String crusr;

    /**
     * 请求主机地址
     */
    private String reqhost;

    /**
     * 执行主机地址
     */
    private String dohost;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        FiCpdoTrace other = (FiCpdoTrace) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getTaskid() == null ? other.getTaskid() == null : this.getTaskid().equals(other.getTaskid()))
            && (this.getTaskname() == null ? other.getTaskname() == null : this.getTaskname().equals(other.getTaskname()))
            && (this.getDomode() == null ? other.getDomode() == null : this.getDomode().equals(other.getDomode()))
            && (this.getTasktype() == null ? other.getTasktype() == null : this.getTasktype().equals(other.getTasktype()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getStartdt() == null ? other.getStartdt() == null : this.getStartdt().equals(other.getStartdt()))
            && (this.getEnddt() == null ? other.getEnddt() == null : this.getEnddt().equals(other.getEnddt()))
            && (this.getDoresult() == null ? other.getDoresult() == null : this.getDoresult().equals(other.getDoresult()))
            && (this.getCrusr() == null ? other.getCrusr() == null : this.getCrusr().equals(other.getCrusr()))
            && (this.getReqhost() == null ? other.getReqhost() == null : this.getReqhost().equals(other.getReqhost()))
            && (this.getDohost() == null ? other.getDohost() == null : this.getDohost().equals(other.getDohost()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getTaskid() == null) ? 0 : getTaskid().hashCode());
        result = prime * result + ((getTaskname() == null) ? 0 : getTaskname().hashCode());
        result = prime * result + ((getDomode() == null) ? 0 : getDomode().hashCode());
        result = prime * result + ((getTasktype() == null) ? 0 : getTasktype().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getStartdt() == null) ? 0 : getStartdt().hashCode());
        result = prime * result + ((getEnddt() == null) ? 0 : getEnddt().hashCode());
        result = prime * result + ((getDoresult() == null) ? 0 : getDoresult().hashCode());
        result = prime * result + ((getCrusr() == null) ? 0 : getCrusr().hashCode());
        result = prime * result + ((getReqhost() == null) ? 0 : getReqhost().hashCode());
        result = prime * result + ((getDohost() == null) ? 0 : getDohost().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", taskid=").append(taskid);
        sb.append(", taskname=").append(taskname);
        sb.append(", domode=").append(domode);
        sb.append(", tasktype=").append(tasktype);
        sb.append(", status=").append(status);
        sb.append(", startdt=").append(startdt);
        sb.append(", enddt=").append(enddt);
        sb.append(", doresult=").append(doresult);
        sb.append(", crusr=").append(crusr);
        sb.append(", reqhost=").append(reqhost);
        sb.append(", dohost=").append(dohost);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}